package com.oss.hotel;

import com.fbzr.aop.AopContext;
import com.fbzr.aop.MetaObjectIntercept;
import com.fbzr.common.utils.xx;
import com.jfinal.plugin.IPlugin;
import com.jfinal.plugin.redis.Cache;
import com.jfinal.plugin.redis.Redis;
import com.jfinal.plugin.redis.RedisPlugin;

public class HotelIntercept extends MetaObjectIntercept {

	@Override
	public void queryBefore(AopContext ac) throws Exception {
		String name = ac.ctrl.getPara("query_name");
		IPlugin plugin = new RedisPlugin("test", "192.168.50.32");
		plugin.start();
		Cache cache = Redis.use("test");
		cache.set("asd", 123);
		if (!xx.isEmpty(name)) {
			ac.condition = " state = " + name;
		}
	}
	
}
